home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / gprof.man < prev    next >
Encoding:
Text File  |  1989-01-05  |  7.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. GPROF                     User Commands                     GPROF
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      gprof - display call-graph profile data
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ggpprrooff [ --aa ] [ --bb ] [ --cc ] [ --ee _n_a_m_e ] [ --EE _n_a_m_e ]
  13.           [ --ff _n_a_m_e ] [ --FF _n_a_m_e ] [ --ss ] [ --zz ]
  14.           [ _o_b_j_e_c_t-_f_i_l_e [ _p_r_o_f_i_l_e-_f_i_l_e ... ] ]
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      _G_p_r_o_f produces an execution profile of C, Pascal, or FORTRAN
  18.      77 programs.  The effect of called routines is incorporated
  19.      in the profile of each caller.  The profile data is taken
  20.      from the call graph profile file (_g_m_o_n._o_u_t default) which is
  21.      created by programs compiled with the --ppgg option of _c_c, _p_c,
  22.      and _f_7_7.  That option also links in versions of the library
  23.      routines which are compiled for profiling.  The symbol table
  24.      in the named object file (_a._o_u_t by default) is read and
  25.      correlated with the call graph profile file.  If more than
  26.      one profile file is specified, the _g_p_r_o_f output shows the
  27.      sum of the profile information in the given profile files.
  28.  
  29.      First, execution times for each routines are propagated
  30.      along the edges of the call graph.  Cycles are discovered,
  31.      and calls into a cycle are made to share the time of the
  32.      cycle.  The first listing shows the functions sorted accord-
  33.      ing to the time they represent, including the time of their
  34.      call graph descendants.  Below each function entry is shown
  35.      its (direct) call-graph children, and how their times are
  36.      propagated to this function.  A similar display above the
  37.      function shows how this function's time and the time of its
  38.      descendants is propagated to its (direct) call-graph
  39.      parents.
  40.  
  41.      Cycles are also shown, with an entry for the cycle as a
  42.      whole and a listing of the members of the cycle and their
  43.      contributions to the time and call counts of the cycle.
  44.  
  45.      Next, a flat profile is given, similar to that provided by
  46.      _p_r_o_f(1).  This listing gives the total execution times and
  47.      call counts for each of the functions in the program, sorted
  48.      by decreasing time.  Finally, an index showing the
  49.      correspondence between function names and call-graph profile
  50.      index numbers.
  51.  
  52.      Beware of quantization errors.  The granularity of the sam-
  53.      pling is shown, but remains statistical at best.  It is
  54.      assumed that the time for each execution of a function can
  55.      be expressed by the total time for the function divided by
  56.      the number of times the function is called.  Thus the time
  57.      propagated along the call-graph arcs to parents of that
  58.      function is directly proportional to the number of times
  59.      that arc is traversed.
  60.  
  61.  
  62.  
  63. Sprite v1.0               22 April 1986                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GPROF                     User Commands                     GPROF
  71.  
  72.  
  73.  
  74.      The profiled program must call _e_x_i_t(2) or return normally
  75.      for the profiling information to be saved in the _g_m_o_n.._o_u_t
  76.      file.
  77.  
  78. OOPPTTIIOONNSS
  79.      --aa   suppress printing statically declared functions.  If
  80.           this option is given, all relevant information about
  81.           the static function (for instance, time samples, calls
  82.           to other functions, calls from other functions) belongs
  83.           to the function loaded just before the static function
  84.           in the _a.._o_u_t file.
  85.  
  86.      --bb   Brief.  Suppress descriptions of each field in the pro-
  87.           file.
  88.  
  89.      --cc   the static call-graph of the program is discovered by a
  90.           heuristic which examines the text space of the object
  91.           file.  Static-only parents or children are indicated
  92.           with call counts of 0.
  93.  
  94.      --ee _n_a_m_e
  95.           suppress printing the graph profile entry for routine
  96.           _n_a_m_e and all its descendants (unless they have other
  97.           ancestors that aren't suppressed).  More than one --ee
  98.           option may be given.  Only one _n_a_m_e may be given with
  99.           each --ee option.
  100.  
  101.      --EE _n_a_m_e
  102.           suppress printing the graph profile entry for routine
  103.           _n_a_m_e (and its descendants) as --ee, above, and also
  104.           exclude the time spent in _n_a_m_e (and its descendants)
  105.           from the total and percentage time computations.  More
  106.           than one --EE option may be given.  For example, --EE
  107.           _m_c_o_u_n_t --EE _m_c_l_e_a_n_u_p is the default.
  108.  
  109.      --ff _n_a_m_e
  110.           print the graph profile entry only for routine _n_a_m_e and
  111.           its descendants.  More than one --ff option may be given.
  112.           Only one _n_a_m_e may be given with each --ff option.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               22 April 1986                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GPROF                     User Commands                     GPROF
  137.  
  138.  
  139.  
  140.      --FF _n_a_m_e
  141.           print the graph profile entry only for routine _n_a_m_e and
  142.           its descendants (as --ff,, above) and also use only the
  143.           times of the printed routines in total time and percen-
  144.           tage computations.  More than one --FF option may be
  145.           given.  Only one _n_a_m_e may be given with each --FF option.
  146.           The --FF option overrides the --EE option.
  147.  
  148.      --ss   produce a profile file _g_m_o_n.._s_u_m which represents the
  149.           sum of the profile information in all the specified
  150.           profile files.  This summary profile file may be given
  151.           to subsequent executions of _g_p_r_o_f (probably also with a
  152.           --ss) option to accumulate profile data across several
  153.           runs of an _a.._o_u_t file.
  154.  
  155.      --zz   display routines which have zero usage (as indicated by
  156.           call counts and accumulated time).  This is useful in
  157.           conjunction with the --cc option for discovering which
  158.           routines were never called.
  159.  
  160. FFIILLEESS
  161.      a.out          the namelist and text space
  162.      gmon.out       dynamic call-graph and profile
  163.      gmon.sum       summarized dynamic call-graph and profile
  164.  
  165. SSEEEE AALLSSOO
  166.      monitor(3), profil(2), cc(1), prof(1)
  167.      Graham, S.L., Kessler, P.B., McKusick, M.K., `gprof: A Call
  168.      Graph Execution Profiler', _P_r_o_c_e_e_d_i_n_g_s _o_f _t_h_e _S_I_G_P_L_A_N '_8_2
  169.      _S_y_m_p_o_s_i_u_m _o_n _C_o_m_p_i_l_e_r _C_o_n_s_t_r_u_c_t_i_o_n, SIGPLAN Notices, Vol.
  170.      17, No. 6, pp. 120-126, June 1982.
  171.  
  172. BBUUGGSS
  173.      Parents which are not themselves profiled will have the time
  174.      of their profiled children propagated to them, but they will
  175.      appear to be spontaneously invoked in the call-graph list-
  176.      ing, and will not have their time propagated further.  Simi-
  177.      larly, signal catchers, even though profiled, will appear to
  178.      be spontaneous (although for more obscure reasons).  Any
  179.      profiled children of signal catchers should have their times
  180.      propagated properly, unless the signal catcher was invoked
  181.      during the execution of the profiling routine, in which case
  182.      all is lost.
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0               22 April 1986                         3
  196.  
  197.  
  198.  
  199.